package com.example.scaffold.order.bean;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 订单DTO对象
 * 遵循阿里手册：数据对象命名规范，参数校验规范
 *
 * @author example
 */
@Data
@Schema(description = "订单信息DTO")
public class OrderDTO {
    @Schema(description = "订单ID")
    private Long id;

    @NotBlank(message = "用户名不能为空")
    @Size(min = 4, max = 20, message = "用户名长度必须在4-20个字符之间")
    @Schema(description = "用户名", example = "zhangsan")
    private String username;

    @Schema(description = "状态(0-禁用,1-正常)")
    private Integer status;

    @Schema(description = "标志")
    private Boolean flag;

    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    private LocalDateTime updateTime;
}